﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reactive.Linq;
using System.Linq.Expressions;


namespace QbservableCore.Serialization
{
    internal class QbservableProvider: IQbservableProvider
    {
        private IQbservableFactory _factory;
        public QbservableProvider(IQbservableFactory factory)
        {
            _factory = factory;
        }

        #region IQbservableProvider Members

        /// <summary>
        /// Will create the derived Qbservable
        /// </summary>
        /// <typeparam name="TResult"></typeparam>
        /// <param name="expression"></param>
        /// <returns></returns>
        public IQbservable<TResult> CreateQuery<TResult>(Expression expression)
        {
            return _factory.Create<TResult>(expression);
        }

        #endregion
    }
}
